package com.ruoyi.mes.systembasic.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mes.systembasic.mapper.SmesCustomerMapper;
import com.ruoyi.mes.systembasic.domain.SmesCustomer;
import com.ruoyi.mes.systembasic.service.ISmesCustomerService;

/**
 * 客户管理Service业务层处理
 * 
 * @author yanqin
 * @date 2020-11-24
 */
@Service
public class SmesCustomerServiceImpl implements ISmesCustomerService 
{
    @Autowired
    private SmesCustomerMapper smesCustomerMapper;

    /**
     * 查询客户管理
     * 
     * @param customerNo 客户管理ID
     * @return 客户管理
     */
    @Override
    public SmesCustomer selectSmesCustomerById(String customerNo)
    {
        return smesCustomerMapper.selectSmesCustomerById(customerNo);
    }

    /**
     * 查询客户管理列表
     * 
     * @param smesCustomer 客户管理
     * @return 客户管理
     */
    @Override
    public List<SmesCustomer> selectSmesCustomerList(SmesCustomer smesCustomer)
    {
        return smesCustomerMapper.selectSmesCustomerList(smesCustomer);
    }

    /**
     * 新增客户管理
     * 
     * @param smesCustomer 客户管理
     * @return 结果
     */
    @Override
    public int insertSmesCustomer(SmesCustomer smesCustomer)
    {
        smesCustomer.setCreateTime(DateUtils.getNowDate());
        return smesCustomerMapper.insertSmesCustomer(smesCustomer);
    }

    /**
     * 修改客户管理
     * 
     * @param smesCustomer 客户管理
     * @return 结果
     */
    @Override
    public int updateSmesCustomer(SmesCustomer smesCustomer)
    {
        smesCustomer.setUpdateTime(DateUtils.getNowDate());
        return smesCustomerMapper.updateSmesCustomer(smesCustomer);
    }

    /**
     * 批量删除客户管理
     * 
     * @param customerNos 需要删除的客户管理ID
     * @return 结果
     */
    @Override
    public int deleteSmesCustomerByIds(String[] customerNos)
    {
        return smesCustomerMapper.deleteSmesCustomerByIds(customerNos);
    }

    /**
     * 删除客户管理信息
     * 
     * @param customerNo 客户管理ID
     * @return 结果
     */
    @Override
    public int deleteSmesCustomerById(String customerNo)
    {
        return smesCustomerMapper.deleteSmesCustomerById(customerNo);
    }
}
